package cn.ww.jmstemplate;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
/**
 * a异步消息监听
 * @author yaoayao
 *
 */
@Component
public class Listener1 {
    // 用String 接收
    // @JmsListener(destination = "SVW.S1120001B.MSG.OUT")
    public void receive(String msg) {
        System.out.println("监听到的消息内容为: " + msg);
    }
    //可以用javaBean接收
    @JmsListener(destination = "SVW.S1120001B.MSG.OUT")
    public void receive(User msg) {
        System.out.println("监听到的消息内容为: " + msg.getName());
    }


}